package com.jmb.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * 
 * @TableName t_permission
 */
@TableName(value ="t_permission")
@Data
public class Permission extends BaseEntity {

    /**
     * 权限编号 对应代码中@RequiresPermissions 的value
     */
    @Schema(description = "权限编号 ")
    @NotNull(message = "权限代码不能为空")
    @NotEmpty(message = "权限代码不能为空")
    @Size(max = 255, message = "权限代码长度必须小于等于255")
    @TableField(value = "permission_code")
    private String permissionCode;

    /**
     * 权限名称
     */
    @Schema(description = "权限名称")
    @NotNull(message = "权限名称不能为空")
    @NotEmpty(message = "权限名称不能为空")
    @Size(max = 255, message = "权限名称长度必须小于等于255")
    @TableField(value = "permission_name")
    private String permissionName;

    /**
     * 父节点id
     */
    @Schema(description = "父节点id")
    @TableField(value = "parent_id")
    private Integer parentId ;
}